package com.mls.fivedistrict.task;

import com.mls.fivedistrict.pojo.Record;
import com.mls.fivedistrict.server.RecordService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 记录回收的任务
 * Created by chenxiuxiang on 2018/3/25.
 */
@Slf4j
public class RecordRecycleTask {
    @Autowired
    RecordService recordService;

    /**
     * 记录超时未领取关闭
     */
    public void recordRecy() {
        log.info("记录超时未领取关闭");
        List<Record> recordListByTask = recordService.getRecordListByTask();
        if (recordListByTask.size() > 0) {
            recordService.recycleBatch(recordListByTask);
        }

    }
}
